package com.dmx.cep.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.dmx.cep.dao.ContentDao;
import com.dmx.cep.entity.AdiImportTask;
import com.dmx.cep.entity.FtpServerConfig;
import com.dmx.cep.entity.VodContentInfo;
import com.dmx.cep.entity.VodContentStatus;
import com.dmx.cep.service.ContentService;
import com.dmx.cep.ws.datamodel.ContentStatus;
import com.dmx.fw.service.impl.BaseServiceImpl;

public class ContentServiceImpl extends BaseServiceImpl implements ContentService {
	
	private ContentDao contentDao;

	public ContentDao getContentDao() {
		return contentDao;
	}

	public void setContentDao(ContentDao contentDao) {
		this.contentDao = contentDao;
	}
	
	public List<AdiImportTask> getAdiImportTasks(String siteId,int maxRecords){
		return contentDao.getAdiImportTasks(siteId,maxRecords);
	}
	
	public FtpServerConfig  getFtpServer(int ftpType){
		return contentDao.getFtpServer(ftpType);
	}

	@Override
	public void contentDelete(String[] contentIDList) throws DataAccessException {
		// TODO Auto-generated method stub
		contentDao.contentDelete(contentIDList);
	}
	
	@Override
	public void deleteContent(String[] contentIDList) throws DataAccessException {
		// TODO Auto-generated method stub
		contentDao.deleteContent(contentIDList);
	}

	@Override
	public void contentUpdate(ContentStatus[] contentStatusList) throws DataAccessException {
		// TODO Auto-generated method stub
		contentDao.contentUpdate(contentStatusList);
	}
	
	public int getAssetStatus(String assetId) throws DataAccessException{
		return contentDao.getAssetStatus(assetId);
	}
	
	public List<Object[]> getContentTypeList() throws Exception{
		return contentDao.getContentTypeList();
	}

	@Override
	public void saveOrUpdateContentData(VodContentInfo contentInfo,
			VodContentStatus contentStatus) throws Exception {
		// TODO Auto-generated method stub
		contentDao.saveObject(contentInfo);
		contentDao.saveObject(contentStatus);
	}

	@Override
	public int countCaptionTask() throws Exception {
		// TODO Auto-generated method stub
		return contentDao.countCaptionTask();
	}
}
